<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   design_default
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>

<div class="page-head">
    <h3><?php echo $this->__("Oops! We're sorry") ?></h3>
    <div class="error-msg" ><?php echo $this->__("Error Messages: ") ?><?php echo $_SESSION['orderInfo'];?></div>
</div>

<div style="float:left;height:240px;margin:20px; padding-top: 30px;"><img height="120px" src="<?php echo $this->getSkinUrl('images/creditcard/failure.png') ?>" /></div>

<div style="padding: 20px;" >
<?php if ($this->getRealOrderId()) : ?><p><?php echo $this->__('Your Order No. is ') . $this->getRealOrderId() ?></p><?php endif ?>

<?php if($_SESSION['errorCode'] == 'I0061'){?>
     <?php //订单号重复  ?>
     <p><?php echo $this->__("We are confirming your order, please do not duplicate payments, if the order status is \"pending\", please contact us for verification.") ?></p>

<?php } elseif ($_SESSION['errorCode'] == 'R0000') {?>
     <?php //高风险订单  ?>
     <p><?php echo $this->__("We have received your order.
        But your payment has not been processed at this time, we are sorry for any inconvenience.<br>
        Note:<br>
        1.	Please make sure your credit card is valid and you have entered your card information correctly.<br>
        2.	If your transaction was declined, please use another card to pay.") ?></p>

<?php } elseif ($_SESSION['errorCode'] == 'E0008') {?>
     <?php //客人取消交易  ?>
     <p><?php echo $this->__("Transaction has been canceled.") ?></p>

<?php } elseif ($_SESSION['errorCode'] == 'I0013') {?>
     <?php //加密值错误     ?>
     <p><?php echo $this->__("Please check your <b>signInfo</b>.") ?></p>

<?php } elseif ($_SESSION['donothonour'] == '1' || $_SESSION['refertocardissuer'] == '1') {?>     
     <?php //Do not honour  ?>
     <p><?php echo $this->__("
     Due to the reason of your credit/debit card issuing bank, your payment was not be approved.<br><br>
     		
     There are some very important information can help you to complete the payment:<br><br>
     		
     1. You can call your credit/debit card issuing bank to let them know you are the card holder and the payment was making by you. It will be 100% successful if the issuing bank receives your phone, it is the best way to fix the problem.<br><br>
     		
     2. You may be warned from your issuing bank that the payment is a cross-border transaction. Please don't worry about that, because the website uses a Hongkong's bank as the acquiring bank. The transaction is safe, please contact us if you have any question.<br><br>
     		
     3. The simplest way is you to pay again or change another card.");?>
     		
<?php } else {?>
     <?php //其他错误  ?>
     <p><?php echo $this->__("We have received your order.
        But your payment has not been processed at this time, we are sorry for any inconvenience.<br>
        Note:<br>
        1.	Please make sure your credit card is valid and you have entered your card information correctly.<br>
        2.	If your transaction was declined, please use another card to pay.") ?></p>

<?php }?> 	



<p><?php echo $this->__('Please <a href="%s">continue shopping</a>.', $this->getContinueShoppingUrl()) ?></p>

</div>
<?php
//注销session里的重新支付留下的repaymentorderid和isrepayment变量
if(!(Mage::getSingleton("core/session")->getData("isrepayment")) == null){
	Mage::getSingleton("core/session")->unsetData("isrepayment");
}
if(!(Mage::getSingleton("core/session")->getData("repay_IncrementId")) == null){
	Mage::getSingleton("core/session")->unsetData("repay_IncrementId");
}
?>